package com.sb.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class Regex {
    private final static Logger logger= LoggerFactory.getLogger(FileUtils.class);

    private static final String EQUER = "=";
    private static final String WITH = "&";

    public static String regexStr(String str, String rex) {
        Pattern pattern = Pattern.compile(rex);
        Matcher match = pattern.matcher(str);
        if (match.find()) {
            return match.group(1);
        }
        return null;
    }

    public static boolean isMatch(String str, String rex) {
        Pattern pattern = Pattern.compile(rex);
        Matcher match = pattern.matcher(str);
        if (match.find()) {
            return true;
        }
        return false;
    }


}
